﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
namespace IHISCETeim.Web.MachineSys.UserModel
{
    public partial class UClaimDemageControlUpdateSupplerDetail : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.查看 };
            }
        }
        protected override string DWZRef
        {
            get { return "UClaimDemageControlList"; }
        }

      
        /// <summary>
        /// 需要修改的ID
        /// </summary>
        protected string ClaimsNumber
        {
            get
            {
                return GetRequestValue<string>("ClaimsNumber");
            }
        }

        private DataTable _SupplerDetailDT;
        protected DataTable SupplerDetailDT
        {
            get
            {
                if (_SupplerDetailDT == null)
                {
                    _SupplerDetailDT = UClaimDemageControlController.GetDetailByClaimsNumber(ClaimsNumber);
                    if (_SupplerDetailDT.Rows.Count < 10)
                    {
                        int oldRowCount = _SupplerDetailDT.Rows.Count;
                        int newRowCount = 10 - oldRowCount;
                        for (int i = 0; i < newRowCount; i++)
                        {
                            DataRow dr = _SupplerDetailDT.NewRow();
                            _SupplerDetailDT.Rows.Add(dr);
                        }
                    }

                }
                return _SupplerDetailDT;
            }
        }
        private UClaimDemageControlDetailInfo _onlyworkObj;
        protected UClaimDemageControlDetailInfo onlyworkObj
        { 
             get
            {
                if (_onlyworkObj == null)
                {
                    _onlyworkObj = UClaimDemageControlController.GetDetailByClaimsNumber2(ClaimsNumber).Find(e=>e.OnlyWork==true);
                    if(_onlyworkObj==null)
                        _onlyworkObj=new UClaimDemageControlDetailInfo();
                }
                return _onlyworkObj;
            }
        }
        

        protected void Page_Load(object sender, EventArgs e)
        {
          //  rpSupplerDetail3.DataSource = SupplerDetailDT;
           // rpSupplerDetail3.DataBind();
            rpSupplerDetail4.DataSource = SupplerDetailDT;
            rpSupplerDetail4.DataBind();
            

        }
    }
}